/*
 * @Author: AI Assistant
 * @Date: 2024-12-19
 * @Description: 站点信息模型
 */
import { ApiProperty } from '@nestjs/swagger';
import { modelOptions, prop } from '@typegoose/typegoose';
import { IsNotEmpty, IsOptional, Allow } from 'class-validator';

@modelOptions({
  // 自动为每个属性添加时间戳
  schemaOptions: {
    timestamps: true,
  },
})
export class SiteInfo {
  @ApiProperty({ description: '站点标题' })
  @IsNotEmpty({ message: '站点标题不能为空' })
  @prop()
  siteTitle: string;

  @ApiProperty({ description: '站点副标题' })
  @IsOptional()
  @prop()
  siteSubtitle: string;

  @ApiProperty({ description: '站点域名' })
  @IsNotEmpty({ message: '站点域名不能为空' })
  @prop()
  siteDomain: string;

  @ApiProperty({ description: '站点LOGO地址' })
  @IsOptional()
  @prop()
  siteLogoUrl: string;

  @ApiProperty({ description: '站点icon' })
  @IsOptional()
  @prop()
  icon: string;

  @ApiProperty({ description: '站点关键字' })
  @IsOptional()
  @prop()
  siteKeywords: string;

  @ApiProperty({ description: '站点描述' })
  @IsOptional()
  @prop()
  siteDescription: string;

  @ApiProperty({ description: '站点备案' })
  @IsOptional()
  @prop()
  siteRecord: string;

  @ApiProperty({ description: '站点模板' })
  @IsOptional()
  @prop()
  siteTemplate: "default" | "v1" | "v2";

  @ApiProperty({ description: '尾部信息' })
  @IsOptional()
  @prop()
  footerInfo: string;

  @ApiProperty({ description: '默认语言' })
  @IsOptional()
  @prop()
  defaultLanguage: string;

  // 统计代码
  @ApiProperty({ description: '统计代码' })
  @IsOptional()
  @prop()
  extendCode: string;

  @Allow()
  createdAt: string;

  @Allow()
  updatedAt: string;

  @Allow()
  __v: string;
}